package cn.edu.xmu.oomall.wechatpay.mapper.generator;

import cn.edu.xmu.oomall.wechatpay.mapper.generator.po.RefundTransPo;
import cn.edu.xmu.oomall.wechatpay.mapper.generator.po.RefundTransPoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface RefundTransPoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @Delete({
        "delete from wechatpay_refund_trans",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @Insert({
        "insert into wechatpay_refund_trans (`id`, `sub_mchid`, ",
        "`transaction_id`, `amount_total`, ",
        "`amount_payer_total`, `amount_settlement_total`, ",
        "`amount_refund`, `amount_payer_refund`, ",
        "`amount_settlement_refund`, `amount_discount_refund`, ",
        "`out_refund_no`, `out_trade_no`, ",
        "`user_received_account`, `create_time`, ",
        "`status`)",
        "values (#{id,jdbcType=BIGINT}, #{subMchid,jdbcType=VARCHAR}, ",
        "#{transactionId,jdbcType=VARCHAR}, #{amountTotal,jdbcType=INTEGER}, ",
        "#{amountPayerTotal,jdbcType=INTEGER}, #{amountSettlementTotal,jdbcType=INTEGER}, ",
        "#{amountRefund,jdbcType=INTEGER}, #{amountPayerRefund,jdbcType=INTEGER}, ",
        "#{amountSettlementRefund,jdbcType=INTEGER}, #{amountDiscountRefund,jdbcType=INTEGER}, ",
        "#{outRefundNo,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR}, ",
        "#{userReceivedAccount,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="refundId", before=false, resultType=String.class)
    int insert(RefundTransPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @InsertProvider(type=RefundTransPoSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="refundId", before=false, resultType=String.class)
    int insertSelective(RefundTransPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @SelectProvider(type=RefundTransPoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sub_mchid", property="subMchid", jdbcType=JdbcType.VARCHAR),
        @Result(column="transaction_id", property="transactionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount_total", property="amountTotal", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_payer_total", property="amountPayerTotal", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_settlement_total", property="amountSettlementTotal", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_refund", property="amountRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_payer_refund", property="amountPayerRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_settlement_refund", property="amountSettlementRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_discount_refund", property="amountDiscountRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_received_account", property="userReceivedAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    List<RefundTransPo> selectByExample(RefundTransPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "`id`, `sub_mchid`, `transaction_id`, `amount_total`, `amount_payer_total`, `amount_settlement_total`, ",
        "`amount_refund`, `amount_payer_refund`, `amount_settlement_refund`, `amount_discount_refund`, ",
        "`out_refund_no`, `refund_id`, `out_trade_no`, `user_received_account`, `create_time`, ",
        "`status`",
        "from wechatpay_refund_trans",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sub_mchid", property="subMchid", jdbcType=JdbcType.VARCHAR),
        @Result(column="transaction_id", property="transactionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount_total", property="amountTotal", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_payer_total", property="amountPayerTotal", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_settlement_total", property="amountSettlementTotal", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_refund", property="amountRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_payer_refund", property="amountPayerRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_settlement_refund", property="amountSettlementRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="amount_discount_refund", property="amountDiscountRefund", jdbcType=JdbcType.INTEGER),
        @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_received_account", property="userReceivedAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    RefundTransPo selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @UpdateProvider(type=RefundTransPoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") RefundTransPo row, @Param("example") RefundTransPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @UpdateProvider(type=RefundTransPoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") RefundTransPo row, @Param("example") RefundTransPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @UpdateProvider(type=RefundTransPoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(RefundTransPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_refund_trans
     *
     * @mbg.generated
     */
    @Update({
        "update wechatpay_refund_trans",
        "set `sub_mchid` = #{subMchid,jdbcType=VARCHAR},",
          "`transaction_id` = #{transactionId,jdbcType=VARCHAR},",
          "`amount_total` = #{amountTotal,jdbcType=INTEGER},",
          "`amount_payer_total` = #{amountPayerTotal,jdbcType=INTEGER},",
          "`amount_settlement_total` = #{amountSettlementTotal,jdbcType=INTEGER},",
          "`amount_refund` = #{amountRefund,jdbcType=INTEGER},",
          "`amount_payer_refund` = #{amountPayerRefund,jdbcType=INTEGER},",
          "`amount_settlement_refund` = #{amountSettlementRefund,jdbcType=INTEGER},",
          "`amount_discount_refund` = #{amountDiscountRefund,jdbcType=INTEGER},",
          "`out_refund_no` = #{outRefundNo,jdbcType=VARCHAR},",
          "`refund_id` = #{refundId,jdbcType=VARCHAR},",
          "`out_trade_no` = #{outTradeNo,jdbcType=VARCHAR},",
          "`user_received_account` = #{userReceivedAccount,jdbcType=VARCHAR},",
          "`create_time` = #{createTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=VARCHAR}",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(RefundTransPo row);
}